About 479 letters

About 2 minutes

#abs

Description: Calculate the absolute value.

def abs(x): ''' Calculate the absolute value of the argument. :param x: The value to compute :return: The absolute value of x '''

Example:

print(abs(-100)) print(abs(-233.3333)) print(abs(0)) print(abs(128))

>>> Establishing WebAssembly Runtime.

>>> Standby.

Powered by Shift.

Created in 6/9/2025

Updated in 6/9/2025